<?php
/*
 * @Package Softpin Order Manager
 * @Subpackage : simorder Manager
 * Create by : thuc.lehuy@gmail.com
 */
// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
//import view parent class
jimport( 'joomla.application.component.view' );

class SimViewSim extends JView
{
    function display($tpl=null){
        $document = & JFactory::getDocument();
        $document->setTitle('Mời bạn mua sim');
         // get the total number of records
        $db = & JFactory::getDBO();
        $sim_id = JRequest::getVar("sim_id");
        if(is_numeric($sim_id))
            $query = 'SELECT S.*, c.categori_name, pr.provider_name'
                .' FROM #__sim AS S'
                .' LEFT JOIN #__sim_categories AS c ON c.categori_id = S.categori_id'
                .' LEFT JOIN #__sim_provider AS pr ON pr.provider_id = S.provider_id'
                .' WHERE sim_id='.$sim_id;
        else return FALSE;
        $db->setQuery($query);
        $sim = $db->loadObject();

        $this->assignRef('param', JRequest::get());
        $this->assignRef('sim', $sim);
        parent::display($tpl);
    }
    
}


